// Mesh Loader
// (c) jimon game studio

#ifndef JEH_CMESHLOADER
#define JEH_CMESHLOADER

#include "IMeshLoader.h"
#include "jeStl.h"

#define JE_SUPPORT_FILEFORMAT_JED
#define JE_SUPPORT_FILEFORMAT_SBS
#define JE_SUPPORT_FILEFORMAT_B3D

namespace je
{
	namespace scene
	{
		//! Mesh Loader
		class CMeshLoader:public je::scene::IMeshLoader
		{
		private:
			//! Loaders List Type
			typedef je::jeList<IMeshFormatLoader*> MeshLoadersList;

			//! Loaders List
			MeshLoadersList * Loaders;
		public:
			//! Constructor
			CMeshLoader();

			//! Destructor
			~CMeshLoader();

			//! Load Mesh
			jeMesh * LoadMesh(core::IBuffer * DataBuffer,video::IRender * Render);

			//! Save Mesh
			void SaveMesh(core::IBuffer * Buffer,jeMesh * Mesh,MeshFormat Format);

			//! Register Format Loader
			void RegisterFormatLoader(IMeshFormatLoader * FormatLoader);

			//! UnRegister Format Loader
			void UnRegisterFormatLoader(IMeshFormatLoader * FormatLoader);

			//! Get Format Loader
			IMeshFormatLoader * GetFormatLoader(MeshFormat Format);
		};
	}
}

#endif
